home *** CD-ROM | disk | FTP | other *** search
- ;;; -*- Scheme -*-
-
- #|
- Description:
-
- Usage:
- (do-it 2 3) -> inapplicable object 1
- (with-mumble + (lambda () (do-it 2 3))) -> 5
- (do-it 2 3) -> inapplicable object 1
- (set! mumble do-it)
- (do-it 2 3) -> infinite loop
- (with-mumble + (lambda () (do-it 2 3))) -> 5
- (do-it 2 3) -> inifinite loop
- |#
-
- (declare (usual-integrations))
-
- (define mumble 1)
-
- (define (with-mumble val thunk)
- (let ((old mumble))
- (set! mumble val)
- (let ((res (thunk)))
- (set! mumble old)
- res)))
-
- (define (do-it x y)
- (mumble x y))